package com.study.mvc.common;

import javax.servlet.*;
import java.io.IOException;

/**
 * @author wei.zhao
 * @date 2021年12月01日 16:26
 */
public class MyFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) {
        System.out.println("自定义过滤器初始化！");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("自定义过滤器执行了！");
        filterChain.doFilter(servletRequest, servletResponse);
    }

    @Override
    public void destroy() {
        System.out.println("自定义过滤器销毁！");
    }

}
